{% extends 'system_template/public/base_main.html' %}
{% block cite %}
    系统管理员
{% endblock %}
{% block content %}
    <div class="layui-card-header">
        <button class="layui-btn layui-btn-danger" onclick="checkbox(this,'DELETES')">
            <i class="layui-icon"></i>批量删除
        </button>
        <button class="layui-btn layui-btn-normal" onclick="tl_cms.open('添加管理员','{{ url_for('sys_bp.member_add') }}',650,400)">
            <i class="layui-icon"></i>添加
        </button>
    </div>
    <table class="layui-table layui-form">
        <thead>
        <tr>
            <th>
                <input type="checkbox" lay-skin="primary" lay-filter="c_all">
                <div class="layui-unselect layui-form-checkbox" lay-skin="primary"><i
                        class="layui-icon layui-icon-ok"></i></div>
            </th>
            <th>登录名</th>
            <th>状态信息</th>
            <th>备注信息</th>
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {% for data in data_list %}
            <tr>
                <td>
                    <input type="checkbox" name="" lay-skin="primary" value="{{ data.id }}">
                    <div class="layui-unselect layui-form-checkbox" lay-skin="primary">
                        <i class="layui-icon layui-icon-ok"></i>
                    </div>
                </td>
                <td>{{ data.username }}</td>
                <td>{{ data.status|status }}</td>
                <td>{{ data.remark }}</td>
                <td>{{ data.update_time }}</td>
                <td class="td-manage">
                    {% if current_user.is_authenticated and  current_user.id==data.id %}
                        <a class="but_sm" title="修改" href="javascript:;" onclick="tl_cms.open('修改信息','{{ url_for('sys_bp.member_edit') }}',650,400)">
                            修改</a>
                    {% endif %}
                    {% if current_user.is_authenticated and  current_user.id!=data.id and data.id!=1 %}
                        <a class="but_sm del_but" title="删除" onclick="del(this,'{{ data.id }}')" href="javascript:;">
                            删除</a>
                    {% endif %}
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>


    {% if page.pages>1 %}
        <div class="layui-card-body ">
            <div class="page">
                <div>
                    <a {% if page.has_prev %}class="next" href="?page={{ page.prev_num }}" {% else %}class="layui-btn-disabled"{% endif %}>上一页</a>
                    {% for pg in page.iter_pages(2,2,2,2) %}
                        {% if page.page==pg %}
                            <span class="current">{{ pg }}</span>
                        {% else %}
                            {% if pg %}
                                <a class="num" href="?page={{ pg }}">{{ pg }}</a>
                            {% endif %}
                        {% endif %}
                    {% endfor %}
                    {% if not page.pages==page.page %}
                        <a class="num" href="?page={{ page.pages }}">最后一页</a>
                    {% endif %}
                    <a {% if page.has_next %}class="next" href="?page={{ page.next_num }}" {% else %}class="layui-btn-disabled"{% endif %}>下一页</a>
                </div>
            </div>
        </div>
    {% endif %}
{% endblock %}
